﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Repository.Migrations
{
    public partial class Initial : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "user_info",
                columns: table => new
                {
                    key_id = table.Column<long>(type: "bigint", nullable: false),
                    user_name = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "用户名")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    password = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "密码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    age = table.Column<int>(type: "int", nullable: true, comment: "年龄"),
                    sex = table.Column<int>(type: "int", nullable: true, comment: "性别"),
                    money = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "余额"),
                    create_user_id = table.Column<long>(type: "bigint", nullable: true),
                    update_user_id = table.Column<long>(type: "bigint", nullable: true),
                    create_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    update_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    is_deleted = table.Column<sbyte>(type: "tinyint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_user_info", x => x.key_id);
                },
                comment: "测试用户")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "user_info");
        }
    }
}
